<?php

/**
 * @author juan guillermo Cruz
 * @copyright 2013
 */
include('src/addMovimiento_cs.php');




?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href='css/coolMessage.css' type='text/css' rel='stylesheet' media='screen' />
<link rel="stylesheet" type="text/css" href="mopTip/mopTip-2.2.css">
<title>Adicionar Movimiento :: ASSC</title>
<script language="javaScript" type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="mopTip/mopTip-2.2.js"></script>
<script type="text/javascript" src="js/jquery.pngFix-1.2.js"></script>

<script language="javaScript" type="text/javascript" src="js/jquery.simplemodal.js"></script>
<script language="javaScript" type="text/javascript" src="js/coolMessage.js"></script>

</head>
<body onload="javascript: showMessage(<?php echo $show_msg;?>)">
<?php $item_select = 16;include("menu.php");?><br />
<form name="form1" id="form1" method="post" action="">

    <div class="content_grv">
		<table class="tbl_list">
            <tr>
                <td>
                    <label>Tipo de Movimiento: </label><br />
                    <select name="tipo" id="tipo" >
                        <option value="-1">Seleccione...</option>
                        <option value="ingreso">Ingreso</option>
                        <option value="egreso">Egreso</option>
                    </select>
                </td>
                <td>
                    <label>Valor:</label><br />
                    <input type="text" name="valor" id="valor"/>
                </td>
                <td>
                    <label>Nombre:</label><br />
                    <input type="text" name="nombre" id="nombre"/>
                </td>
                <td>
                    <label>NIT:</label><br />
                    <input type="text" name="nit" id="nit"/>
                </td>
                <td>
                    <label>Descripcion:</label><br />
                    <input type="text" name="descripcion" id="descripcion"/>
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td colspan="6" align="center">
                    <input type="hidden" name="guardar" value="1" />
                    <input type="button" class="button_grv" value="Save" onclick="javascript: return validate();" />
                    <input type="reset" value="Reset" class="button_grv_cancel"/>
                    <input type="button" class="button_grv_cancel" value="Cancel" onClick="javascript:window.location.href='listMovimientos.php';" />
                </td>
            </tr>
        </table>
    </div>
    
</form>    
</body>
</html>
<script language="javascript" type="text/javascript">
function validate(){	
        
		
		var msg = ''; 
        if (document.getElementById("tipo").value == '-1')
            msg = 'Debe seleccionar el tipo de movimiento <br />';
        if (document.getElementById("valor").value == '')
            msg += 'Debe ingresar el valor <br />';
        if (document.getElementById("nombre").value == '')
            msg += 'Debe ingresar el nombre';
        if (document.getElementById("nit").value == '')
            msg += 'Debe ingresar el nit <br />';
        if (document.getElementById("descripcion").value == '')
            msg += 'Debe escribir la descripcion del movimiento';
        
        
		if(msg==''){
			document.getElementById('form1').submit();
			return true;
		}
		else{
			coolMessage("alert", msg);
			return false;
		}		
	}

</script>
<?php include('divscoolmessage.php');?>